﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EuroManager.Domain.Simulator.Engine;
using EuroManager.Domain.Simulator.Tactics;
using EuroManager.Domain.Simulator.Tests.Tactics;
using EuroManager.Domain.Simulator.World;
using NUnit.Framework;

namespace EuroManager.Domain.Simulator.Tests.World
{
    [TestFixture]
    public class TeamTests
    {
        [Test]
        public void ShouldHaveBallWhenItsPlayerOwnsIt()
        {
            FakeGameWorld world = new FakeGameWorld();
            ITeam team = world.Team2;
            
            Player player = world.AddPlayer(team);
            world.Ball.Trap(player);

            Assert.IsTrue(team.HasBall);
        }

        [Test]
        public void ShouldAddPlayer()
        {
            FakeGameWorld world = new FakeGameWorld();
            Team team = world.Team1 as Team;
            Player player = new Player(8, team, team.Opponent, new FakePlayerTactics(), world.Pitch, world.Ball, new FakeRandomizer(), Vector2D.Zero);
            team.AddPlayer(player);

            Assert.IsTrue(team.Players.Contains(player));
        }
    }
}
